import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询乘客列表
export function listPassenger(query) {
  return request({
    url: '/passenger/people/list',
    method: 'get',
    params: query
  })
}

// 查询乘客详细
export function getPassenger(userId) {
  return request({
    url: '/passenger/people/' + parseStrEmpty(userId),
    method: 'get'
  })
}

// 新增乘客
export function addPassenger(data) {
  return request({
    url: '/passenger/people',
    method: 'post',
    data: data
  })
}

// 修改乘客
export function updatePassenger(data) {
  return request({
    url: '/passenger/people',
    method: 'put',
    data: data
  })
}

// 删除乘客
export function delPassenger(userId) {
  return request({
    url: '/passenger/people/' + userId,
    method: 'delete'
  })
}

// 乘客密码重置
export function resetUserPwd(userId, password) {
  const data = {
    userId,
    password
  }
  return request({
    url: '/system/user/resetPwd',
    method: 'put',
    data: data
  })
}

// 查询乘客基础信息
export function getCkBaseInfo() {
  return request({
    url: '/passenger/people/getCkBaseInfo',
    method: 'get'
  })
}
